package com.sg.business.commons.field.processparameter;

import java.util.ArrayList;

import com.mobnut.db.model.PrimaryObject;
import com.sg.bpm.workflow.taskform.IProcessParameterDelegator;

public class ChangetToObjectIdList implements IProcessParameterDelegator {

	@SuppressWarnings("rawtypes")
	@Override
	public Object getValue(String processParameter, String taskDatakey,
			PrimaryObject taskFormData) {
		Object value = taskFormData.getValue(taskDatakey);
		if (value instanceof ArrayList) {
			String result = "";
			ArrayList arrayList = (ArrayList) value;
			for (Object obj : arrayList) {
				if (result != "") {
					result += ",";
				}
				result += obj.toString();
			}
			return result;
		}
		return "";
	}

}
